home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / csubt.c < prev    next >
C/C++ Source or Header  |  1991-09-24  |  2KB  |  79 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20.  
  21. /*
  22.  *  FUNCTION
  23.  *
  24.  *    csubt   double precision complex subtraction
  25.  *
  26.  *  KEY WORDS
  27.  *
  28.  *    csubt
  29.  *    machine independent routines
  30.  *    complex functions
  31.  *    math libraries
  32.  *
  33.  *  DESCRIPTION
  34.  *
  35.  *    Computes double precision complex result of subtraction of
  36.  *    second double precision complex argument from first double
  37.  *    precision complex argument.
  38.  *
  39.  *    Note that the complex subtraction function is so simple that
  40.  *    it would not normally be called as a function but simply
  41.  *    done "inline".  It is supplied mostly for completeness.
  42.  *
  43.  *  USAGE
  44.  *
  45.  *    COMPLEX csubt (z1, z2)
  46.  *    COMPLEX z1;
  47.  *    COMPLEX z2;
  48.  *
  49.  *  PROGRAMMER
  50.  *
  51.  *    Fred Fish
  52.  *    Tempe, Az
  53.  *    (602) 966-8871
  54.  *
  55.  *  INTERNALS
  56.  *
  57.  *    Computes csubt (z1, z2) from:
  58.  *
  59.  *        1.    Let z1 = a + j b
  60.  *            Let z2 = c + j d
  61.  *
  62.  *        2.    Then csubt(z1,z2) = (a - c) + j (b - d)
  63.  *
  64.  */
  65.  
  66. #include <stdio.h>
  67. #include <pmluser.h>
  68. #include "pml.h"
  69.  
  70.  
  71. COMPLEX csubt (z1, z2)
  72. COMPLEX z1;
  73. COMPLEX z2;
  74. {
  75.     z1.real -= z2.real;
  76.     z1.imag -= z2.imag;
  77.     return (z1);
  78. }
  79.